﻿using Admin.CommonLib.Models.Role;
using Admin.CommonLib.Models.User;
using Swimj.CommonLib.Base;
using Swimj.Core.DependencyInjection;

namespace Admin.ApplicationLib.Services
{
    public interface IRoleService : IScopedDependency
    {
        Task<PaginatedResult<RoleInfoResponseDto>> QueryRolesByPageAsync(RoleSearchRequestDto model);

        Task<Result<IList<RoleInfoResponseDto>>> QueryRolesAsync(RoleSearchRequestDto model);

        Task<Result<RoleInfoResponseDto>> GetRoleAsync(Guid id);

        Task<Result<RoleInfoResponseDto>> CreateRoleAsync(RoleEditRequestDto model);

        Task<Result<RoleInfoResponseDto>> UpdateRoleAsync(Guid id, RoleEditRequestDto model);

        Task<Result<RoleInfoResponseDto>> DeleteRoleAsync(Guid id);

        Task<Result<IList<RoleClaimResponseDto>>> QueryPermissionsByRoleIdAsync(Guid id);

        Task<Result<IList<RoleClaimResponseDto>>> UpdatePermissionsByRoleIdAsync(Guid id, List<string> model);

        Task<Tuple<Stream, string>> ExportAsync(RoleSearchRequestDto model);

        Task<Tuple<Stream, string>> ExportTemplateAsync();

        Task<PaginatedResult<UserInfoResponseDto>> QueryUsersByRoleIdAsync(Guid id, UserSearchRequestDto model);

        Task<Result<IList<UserInfoResponseDto>>> UpdateUsersByRoleIdAsync(Guid id, RoleOperateRequestDto model);
        
        Task<Result<IList<RoleImportResponseDto>>> ImportAsync(int importType, MemoryStream memoryStream);
    }
}